package com.zjzywl.smoke.service;

import java.util.Date;
import java.util.List;

import com.zjzywl.smoke.config.BaseDataConfig;
import com.zjzywl.smoke.entity.Alarm;
import com.zjzywl.smoke.util.NotDispose;

public interface AlarmService {
	List<Alarm> findAll();

	List<Alarm> findByBeginTimeBetweenOrderByBeginTime(Date bTime, Date eTime);

	List<Alarm> findByBeginTimeAndDevCode(Date bTime, Date eTime, String devcode);

	List<Alarm> findByBeginTimeAndAddress(Date bTime, Date eTime, String address);

	List<Alarm> findByBeginTimeAndDevCodeAndAlarmTypeCode(Date bTime, Date eTime, String devcode, String alarmTypeCode);

	List<Alarm> findByBeginTimeAndAlarmTypeCode(Date bTime, Date eTime, String alarmTypeCode);

	List getDeviceAlarmCountByTime(String bTime, String eTime, int count);

	List getDeviceAlarmCountByTimeEx(String bTime, String eTime, int count, int alarmTypeCode, String deviceTypeId,
			String userId);

	List getDeviceAlarmCountByTimeEx(String bTime, String eTime, int count, String alarmTypeCode, String deviceTypeId,
			String userId);

	List getOrgAlarmCountByTime(String bTime, String eTime, int i);

	List getOrgAlarmCountByTimeEx(String bTime, String eTime, int i, String alarmTypeCode, String deviceTypeId,
			String userId);

	int findByBegin(Date bTime, Date eTime, int alarmTypeId);

	List findByDisposeStatusAndAlarmType(int i, String alarmFire);

	Alarm findOne(int alarmId);

	void save(Alarm alarm);

	void updateAllDisposeStatus(int disposeStatus, String name, String disposeContent);

	List<Alarm> findByDisposeStatus(int disposeStatus);

	List getOrgAlarmCountByAlarmReasons(String bTime, String eTime, int i, String alarmTypeCode, String deviceTypeId,
			String userId);

	/*
	 * 根据时间段及报警数量条件查询统计设备的报警量 b:开始时间 e:结束时间 byCount:超过该数量的报警才会被返回
	 */
	List getDeviceAlarmCountByTime(String b, String e, Integer byCount);

	List getDeviceAlarmCountByTimeEx(String b, String e, Integer byCount, String alarmCode, String deviceTypeId,
			String userId);

	List getSpeciesAlarmCountByTimeEx(String bTime, String eTime, String alarmTypeCode, String fireCount,
			String userId);

	/*
	 * 根据时间段及组织查询统计设备的报警量 b:开始时间 e:结束时间 orgid:目前没有使用这个条件
	 */
	List getOrgAlarmCountByTime(String b, String e, Integer orgid);

	List getOrgAlarmCountByTimeEx(String b, String e, Integer orgid, String alarmCode, String deviceTypeId,
			String userId);

	List getOrgAlarmCountByAlarmReasons(String b, String e, Integer orgid, String alarmCode, String deviceTypeId,
			String userId);

	List getOrgAlarmCountByAlarmReasons(String bTime, String eTime, String alarmTypeCode, String deviceTypeId,
			String userId, String alarmReasons);

	List getOrgAlarmCountByDevice(String b, String e, Integer orgid, String alarmCode, String deviceTypeId,
			String userId);

	List getOrgAlarmCountByDevice(String b, String e, String alarmCode, String deviceTypeId, String userId,
			String fixedPlace);

	List getAlarmCountByDevice(String b, String e, Integer orgid, String alarmCode, String deviceTypeId, String userId,
			String fixedPlace);

	List getAlarmCount(String bTime, String eTime, String alarmTypeCode, String userId);

	List getAlarmCountByTime(String bTime, String eTime, String alarmTypeCode, String userId);

	/*
	 * userId:用户编码 status:报警处理状态 alarmCode:报警编码 根据用户信息获取未处理的指定报警类型
	 */
	List getByDisposeStatusAndAlarmTypeAndUser(String userId, Integer status, String alarmCode);

	List getByTimeAndDisposeStatusAndAlarmTypeAndUser(String currentWeekTime, String currentTime, String userId,
			Integer status, String alarmCode);

	List getByDisposeStatusAndAlarmType(String userId, Integer status, String alarmCode);

	/*
	 * 报警历史记录查询
	 * 
	 * bTime,eTime:报警时间段 alarmCode:报警编码 deviceTypeId:设备类型编码(自增长编号)
	 * address:报警地址，使用like查询，注意前后不需要添加%，后台实现已经添加 userId:用户编码(自增长编号)
	 * 
	 * 时间段为必填，其他可为空
	 */
	List getAlarmByTimeAndAlarmTypeAndAddressAndUser(String bTime, String eTime, String alarmCode, String deviceTypeId,
			String address, String userId);

	/*
	 * 报警历史记录查询--返回数据精简
	 * 
	 * bTime,eTime:报警时间段 alarmCode:报警编码 deviceTypeId:设备类型编码(自增长编号)
	 * address:报警地址，使用like查询，注意前后不需要添加%，后台实现已经添加 userId:用户编码(自增长编号)
	 * 
	 * 时间段为必填，其他可为空
	 */
	List getAlarmByTimeAndAlarmTypeAndAddressAndUserSimple(String bTime, String eTime, String alarmCode,
			String deviceTypeId, String address, String userId);

	List getAlarmByalarmTypeId(Integer userId, String alarmTypeCode);

	List getFixedPlaceByuser(String userId);

	List getAlarmByTimeAndAlarmTypeAndAddressAndUserAndAlarmReasons(String beginTime, String endTime,
			String alarmTypeCode, String deviceTypeId, String address, String userId, String alarmReasons);
	
	List getByDisposeStatusAndAlarmTypeAndUserAndTime(String beginTime, String endTime, String userId, int i,
			String alarmFire);

}
